﻿using KZ.Express.ENT;
using KZ.Express.Resource;
using KZ.Express.Task;
using KZ.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KZ.Express.Presenter
{
    public class RoleListPresenter : PresenterBase
    {
        public RoleListPresenter(IViewBase view)
            : base(view, new RoleENT())
        {
            _task = new RoleTask();
        }

        public override void Delete(string content)
        {
            try
            {
                _task.Delete(content);
                _view.Table = _task.LoadDataTable(_view.Search);
                _view.SetMessage(Message.BLM_SUC_DELETE.ToString(), true);
            }
            catch (DataAccessException ex)
            {
                throw new BusinessLogicException(ex.Message);
            }
        }
    }
}
